home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / SML⁄NJ 93+ / Documentation / examples / spread / glue.sml < prev    next >
Encoding:
Text File  |  1995-12-30  |  397 b   |  22 lines  |  [TEXT/R*ch]

  1. structure S = Spreadsheet(Parse(Semant));
  2. open S;
  3.  
  4. val say = outputc std_out
  5. fun sayn (i:int) = say(makestring i)
  6.  
  7. fun show(i,j) = 
  8.     let val (s,v) = get(i,j)
  9.      in say "["; sayn i; say ","; sayn j;
  10.     say "] = "; sayn v;
  11.     say "    "; say s; say "\n"
  12.     end;
  13.  
  14. (* set up a simple spreadsheet *)
  15. set(0,0,"40");
  16. set(1,0,"50");
  17. set(2,0,"[0,0]+[1,0]");
  18.  
  19. eval();
  20.  
  21. app show [(0,0),(1,0),(2,0),(3,0)];
  22.